import React, { useCallback, useEffect } from 'react';
import { history } from 'umi';
import { routesPath } from '@/config/routes';
import styles from './index.less';

export default () => {
  const routeNext = useCallback(() => {
    history.push(routesPath.bazi);
  }, []);
  useEffect(() => {
    setTimeout(() => {
      routeNext();
    }, 2000);
  }, []);
  return (
    <div className={styles.home}>
      <div className={styles.anim}>
        <img
          // eslint-disable-next-line global-require
          src={require('@/static/images/home_logo.gif')}
          alt="home"
          onError={routeNext}
          // onLoad={() => {

          // }}
          onClick={routeNext}
        />
      </div>
      <div className={styles.copyright}>@2020 观山人盘 ALL RIGHTS RESERVED</div>
    </div>
  );
};
